『How to make ad-hoc polymorphism less ad hoc』
#論文メモ
型クラスについての論文
Hindley-Milner 型システムに対して、どういった動機でどういう拡張を施したか
Haskellの型クラスを知ってたらとても楽に読むことができるmrsekut.icon
著者はPhilip WadlerとStephen Blott
1988
PDF
邦訳
大まかな流れ
1.Introduction
型クラスの新規性とこの論文の流れについて
2.Limitations of ad-hoc polymorphism
既存の課題について
Standard MLやMirandaのAd Hoc多相には限界がある
既存のアドホック多相の問題点の3つの問題点
算術演算子: ex. +
等値: ==
オブジェクト指向
型クラスはこれらを統一的に解決する
3.An introductory example
Haskellの型クラスの基本
Haskellの型クラスとinstanceの定義の仕方を知ってたら既知
4.Translation
Num型クラスについて、型クラスあり実装を、型クラスなし実装に変換する
5.A further example: equality
等値(==)の変換について、型クラスあり実装を、型クラスなし実装に変換する
ユーザー定義型にも拡張できる点
インスタンスにする際の制限などが4節と異なる
6.Subclasses
型クラスの継承関係について
7.Conclusion
類似のKaesの成果より優れている点など
A. Typing and translation rules
型クラスの脱糖の形式的な定義
overはclassと同じ
instはinstanceと同じ
未読
memo
新規性
型クラスの提案
Ad Hoc多相の新しいアプローチ
Hindley-Milner 型システムの拡張
既存のもの
Standard MLのeqtype variable
Ad Hoc多相
アドホック多相と型クラスらへんにも書いた
パラメトリック多相に関する確立されたものがHindley-Milner 型システムで、Ad Hoc多相でそれを狙ったのが型クラス、みたいな感じ?
During the inference process, it is possible to translate a program using type classes to an equivalent program that does not use oberloading.
ってどういう意味?
「型クラスを用いると等価なプログラマうに変換できる」の指す意味がよく??
#??
bounded quantification of types
型の有界量化の指す意味
SMLでのoverloadの仕方
OOPのサブタイピング多相の辞書の作り方
型クラスを作るときの参考にされたらしい
読みたい関連論文
Hindley-Milner 型システム関係
The Principal Type-Scheme of an Object in Combinatory Logic
A Theory of Type Polymorphism in Programming
Principal type-schemes for functional programs
派生型 (derived type)関係
On Understanding Types, Data Abstraction, and Polymorphism
Three approaches to type structure
Structural subtyping and the notion of power type pdf
抽象データ型
Abstract types have existential type
Robin Milner
関連
https://jutememo.blogspot.com/2009/05/haskell.html
http://okmij.org/ftp/Computation/typeclass.html